package com.qingcheng.controller.order;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.order.CategoryReportService;
import com.qingcheng.service.order.CreateDateService;
import com.qingcheng.service.order.OrderService;
import org.springframework.stereotype.Component;


/**
 * 定时任务
 * 每隔5分钟,扫一下订单表,查看哪些订单超时了,并修改超时的订单状态(关闭订单)
 */
@Component
public class OrderTask {

    @Reference
    private OrderService orderService;

    @Reference
    private CategoryReportService categoryReportService;

    @Reference
    private CreateDateService createDateService;
//    @Scheduled(cron = "0 */5 * * * ?")
//    public void orderTimeOutLogic(){
//        //每隔5分钟,调用一次方法
//       orderService.orderTimeOutLogic();
//    }


//    @Scheduled(cron = "0 36 21 * * ?")
//    public void orderTimeOutLogic(){
//        System.out.println("run----------------->");
//        LocalDate localDate = LocalDate.parse("2019-04-15", DateTimeFormatter.ofPattern("yyyy-MM-dd"));// 得到指定的日期
//        createDateService.createDate(localDate);
//    }
}



